<template>
  <div class="fanDetail">
     <Header iconColor="#fff" background="rgba(0, 0, 0, 0)"/>
    <div class="image">
        <van-image :src="require('../../assets/img/info.png')" />
    </div>
    <div class="content">
      <div class="desc p8">
        <p class="ddd">绶带琼枝明黄折扇绶带琼枝明黄折扇绶带琼枝明黄折扇绶带琼枝明黄折扇</p>
        <div class="label">
            <span class="tit">源自馆藏</span>
            <span class="valueTab">
              <span class="name">限量</span>
              1000份
            </span>
        </div>
        <div class="descImg"  @click="alertMenu">
            <div class="img"></div>
        </div>
      </div>
      <div class="comp p8">
        <div class="tit ddd">创作方</div>
        <div class="name ddd">元宇宙国际拍卖有限公司</div>
      </div>
      <div class="comp p8">
        <div class="tit ddd">发行方</div>
        <div class="name ddd">某某数字藏品</div>
      </div>
      <div class="story p8">
         <div class="name ddd">作品故事</div>
          <div class="storyImg"></div>
      </div>
      <div class="purchase p8">
         <div class="name ddd">购买须知</div>
          <p class="ddd5">数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币，数字藏品为虚拟数字货币</p>
      </div>
    </div>
    <van-action-sheet class="fanModel" v-model="show" :actions="actions" cancel-text="取消" round @cancel="toCancel" @select="onSelect" />

    <van-overlay :show="showModel" @click="showModel = false" class="showModel">
      <div class="wrapper" @click.stop>
        <div class="block">
          <van-image :src="require('../../assets/img/info.png')" />
          <div class="mdDesc">
            <div class="name">绶带琼枝明黄折扇</div>
            <p>发现非凡的数字藏品，就在某某数字藏品</p>
            <div class="ewm"></div>
          </div>
          <van-button class="save" block type="info" @click="save">保存相册</van-button>
          <div class="close" @click="showModel = false">
            <van-icon name="cross" />
          </div>
        </div>
      </div>
    </van-overlay>

    <div class="fixedBtm">
      <div class="num">¥ 19.90</div>
      <van-button class="sub" block type="info" @click="subClick">立即购买</van-button>
    </div>
  </div>
</template>

<script>
import { mapGetters, mapActions } from 'vuex'
export default {
  name: 'fanDetail',
  computed: { ...mapGetters({ pageData: 'pageData'}) },
  data () {
    return {
        msg: '',
        showModel: false,
        show: false,
        actions: [
           {
             name: '生成海报',type: 1
            },
            {
              name: '分享好友',type: 2
            },
       
        ]
    }
  },
  methods: {
    save() {
      this.showModel = false
    },
    subClick() {
      this.$router.push({name: 'placeOrder'})
    },
    alertMenu(){
      this.show = true;
    },
    onSelect(item){
      if(item.type==1) {
        this.showModel = true
      }
        console.log(item);
        this.show = false;
        this.$toast({
          message:item.name,
          duration:500
        })
    },
    toCancel(){
      console.log('点击了取消');
    }
  },
  mounted() {
    
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less" scope>
.fanDetail {
    width: 100%;
    padding-bottom: 20px;
    box-sizing: border-box;
   .image {
      width: 100%;
      height: 310px;
      .van-image {
        width: 100%;
        height: 100%;
      }
    }
    .content {
      width: 100%;
      padding: 8px;
      padding-top: 0;
      padding-bottom: 30px;
      box-sizing: border-box;
      .desc {
        position: relative;
        // background: #958CE7;
        height: 64px;
        background: #FFFFFF;
        box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        margin-top: -32px;
        margin-bottom: 10px;
        .descImg {
          position: absolute;
          right: 0;
          top: 0;
          width: 56px;
          height: 100%;
          .img {
            width: 16px;
            height: 16px;
            margin-top: 22px;
            margin-left: 12px;
            background: url('../../assets/img/share_icon.png') no-repeat;
            background-size: 100% 100%;
          }
        }
        p {
          line-height: 1;
          padding: 10px 0;
          padding-right: 34px;
          box-sizing: border-box;
        }
        .valueTab {
          margin-left: 4px;
        }
       .label {
          span{
            display: inline-block;
            padding: 0 8px;
            box-sizing: border-box;
            color: #FFFFFF;
            line-height: 17.5px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
          }
          .tit {
            background-color: #958CE7;
            border-radius: 4px;
            font-size: 11px;
          }
        }
      }
      .comp {
        height: 64px;
        background: #FFFFFF;
        box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        box-sizing: border-box;
        margin-bottom: 10px;
        .tit {
          font-size: 12px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #666666;
          line-height: 1;
          padding: 12px 0 8px 0;
        }
        .name {
          font-size: 15px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 500;
          color: #333333;
        }
      }
      .story {
        width: 100%;
        height: 600px;
        background: #FFFFFF;
        box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        margin-bottom: 10px;
        box-sizing: border-box;
        .name {
          display: block;
          line-height: 1;
          padding-top: 12px;
          padding-bottom: 12px;
          font-size: 15px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 500;
          color: #333333;
        }
        .storyImg {
          width: 100%;
          height: 540px;
          background-color: pink;
          border-radius: 8px;
        }
      }
      .purchase {
        width: 100%;
        height: 140px;
        background: #FFFFFF;
        box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        margin-bottom: 10px;
        box-sizing: border-box;
        .name {
          display: block;
          line-height: 1;
          padding-top: 12px;
          padding-bottom: 12px;
          font-size: 15px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 500;
          color: #333333;
        }
        p {
          font-size: 11px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #999999;
          line-height: 18px;
        }
      }
    }
}
 .fanModel.van-popup--bottom.van-popup--round {
        border-radius: 6px 6px 0 0;
  }
.fanModel {
  .van-action-sheet__item,.van-action-sheet__cancel {
    font-size: 15px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #000000;
  }
  .van-action-sheet__content .van-action-sheet__item:nth-child(1) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

}
.showModel {
  z-index: 999;
  .wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .block {
    position: relative;
    width: 288px;
    height: 360px;
    background-color: #fff;
    border-radius: 10px;
    box-sizing: border-box;
    .close {
      width: 50px;
      height: 50px;
      position: absolute;
      top: -50px;
      right: 0;
      .van-icon {
        color: #fff;
        font-size: 20px;
        margin-top: 16px;
        margin-left: 22px;
      }
    }
    .van-image {
      width: 100%;
      height: 280px;
      border-radius: 10px 10px 0 0;
      overflow: hidden;
    }
    .save.van-button--info {
      width: 200px;
      height: 38px;
      bottom: -70px;
      left: 50%;
      margin-left: -100px;
      position: absolute;
      background: rgba(0, 0, 0, 0);
      border-radius: 20px;
      border: 1px solid #FFFFFF;
    }
    .mdDesc {
        height: 70px;
        position: relative;
        padding: 0 8px;
        box-sizing: border-box;
        .name {
        display: block;
        line-height: 1;
        padding-top: 16px;
        padding-bottom: 12px;
        font-size: 15px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 500;
        color: #333333;
      }
      p {
        font-size: 11px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #999999;
        line-height: 18px;
      }
      .ewm {
        position: absolute;
        top: 0;
        right: 4px;
        width: 70px;
        height: 70px;
        background: #958CE7;
      }
    }
  }
}
</style>
